package org.uni_hi.muus.server.util;

import java.util.Vector;

public class SupportCheck {
	protected static final Vector 
	SUPPORTED_METHODS=initSupportedMethodsVector(),
	SUPPORTED_VERSIONS=initSupportedVersionsVector(); 

	protected static Vector initSupportedMethodsVector(){
		Vector v=new Vector();
		v.addElement("GET");
		v.addElement("POST");
		v.addElement("HEAD");
		return v;
	}

	protected static Vector initSupportedVersionsVector(){
		Vector v=new Vector();
		v.addElement("HTTP/1.0");
		v.addElement("HTTP/1.1");
		return v;
	}
	
	public static boolean isVersionSupported(String version){
		return SUPPORTED_VERSIONS.contains(version);
	}
	
	public static boolean isMethodSupported(String method){
		return SUPPORTED_METHODS.contains(method);
	}
	
	public static String getSupportedMethods(){
		return SUPPORTED_METHODS.toString();
	}
	
	public static String getSupportedVersions(){
		return SUPPORTED_VERSIONS.toString();
	}
}
